import java.util.ArrayList;


public class Car
{
	private String marc;
	private String model;
	private int year;
	
	private ArrayList<Part> parts = new ArrayList<Part>();
	
	
	
	public Car(String marc, String model, int year) {
		this.marc = marc;
		this.model = model;
		this.year = year;
	}
	
	public void addPart(Part part)
	{
		this.getParts().add(part);
	}
	
	public void printCarInfo()
	{
		System.out.println("== Car Info ==");
		System.out.println("Car: " + this.marc);
		System.out.println("Model: " + this.model);
		System.out.println("Year: " + this.year);
		System.out.println();
		System.out.println("=== Parts ===");
		partsInfo();
		
	}

	public String getMarc() {
		return marc;
	}

	public String getModel() {
		return model;
	}
	
	
	private void partsInfo()
	{
		for(int i = 0; i < getParts().size(); i++)
		{
			if(getParts().get(i) != null)
			{
				getParts().get(i).partInfoForCars();
			}
		}
	}
	
	
	void carInfoForParts()
	{
		System.out.println("== Car Info ==");
		System.out.println("Car: " + this.marc);
		System.out.println("Model: " + this.model);
		System.out.println("Year: " + this.year);
		System.out.println();
	}

	public ArrayList<Part> getParts() {
		return parts;
	}

}
